package cn.net.codeplus.controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.plugins.Page;

import cn.net.codeplus.entity.User;
import cn.net.codeplus.service.IUserService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gaojun.zhou
 * @since 2018-03-01
 */
@RestController
@RequestMapping("/user")
public class UserController {
	@Autowired IUserService userService;
	
	@RequestMapping("/list")
	public List<User> list(){
		return userService.selectList(null);
	}
	
	@RequestMapping("/page/{p}")
	public Page<User> page(@PathVariable Integer p){
		return userService.selectPage(new Page<User>(p, 1));
	}
}

